Skip to content

chore(release): refactor create-rc and handle existing remote release branch#3879

Merged
rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:fix-create-rc-remote
Jul 1, 2026
Merged

chore(release): refactor create-rc and handle existing remote release branch#3879
rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:fix-create-rc-remote

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator
  • Move cmd_create_rc logic from release.py to a new create_rc.py module.
  • Move parse_backports from release.py to release_issue.py.
  • Add required --remote flag to create-rc subcommand.
  • Update generate_rc.yml workflow to pass --remote origin.
  • In create-release-branch, detect if remote branch already exists and handle same-commit, fast-forward, and non-fast-forward cases.
  • Add remote_branch_exists and is_ancestor helpers to git.py.

rickeylev added 2 commits July 1, 2026 02:39
This change refactors the create-release-branch subcommand to push the commit SHA directly to the remote branch reference, avoiding checking out the branch locally and changing the working directory state. Tests are updated to match.
… branch

- Move cmd_create_rc logic from release.py to a new create_rc.py module.
- Move parse_backports from release.py to release_issue.py.
- Add required --remote flag to create-rc subcommand.
- Update generate_rc.yml workflow to pass --remote origin.
- In create-release-branch, detect if remote branch already exists and handle same-commit, fast-forward, and non-fast-forward cases.
- Add remote_branch_exists and is_ancestor helpers to git.py.
@rickeylev rickeylev requested a review from aignas as a code owner July 1, 2026 02:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the release tooling by extracting the create-rc subcommand into its own module (create_rc.py), moving parse_backports to release_issue.py, and updating create_release_branch.py to push branches directly without affecting the local checkout. It also introduces new Git helper functions and comprehensive unit tests. The review feedback suggests ensuring that remote branch references are fully updated by fetching the remote before fetching tags, checking out the remote-tracking branch directly to avoid outdated local branch states, and updating the corresponding mock assertions in the tests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tools/private/release/create_rc.py
Comment thread tools/private/release/create_rc.py Outdated
Comment thread tests/tools/private/release/release_test.py Outdated
Comment thread tests/tools/private/release/release_test.py Outdated
rickeylev added 4 commits July 1, 2026 02:52
- Fetch remote before fetching tags.
- Checkout remote-tracking branch directly instead of local branch.
- Remove rocket emoji and add snake and basil emojis to the comment.
- Update tests to match new behavior.
@rickeylev rickeylev merged commit 2241f8b into bazel-contrib:main Jul 1, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant